import torch
import torch.nn as nn

# 带有可学习参数的 BatchNorm1d
m = nn.BatchNorm1d(5)

# 不带可学习参数的 BatchNorm1d
m_no_affine = nn.BatchNorm1d(5, affine=False)

# 创建输入张量
# input_tensor = torch.randn(20,5)
input_tensor = torch.tensor([
    [1.,2.,3.,40.,5.],
[1,2,3,4,5]
])
print(input_tensor.shape)

# 应用 BatchNorm1d
output = m(input_tensor)

print("Output with Learnable Parameters:", output)